This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
fix(deps): update dependency moment-timezone to v0.5.35 [security] #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.5.26
->0.5.35
GitHub Vulnerability Alerts
GHSA-v78c-4p63-2j6c
Impact
grunt data
(orgrunt release
) to prepare a custom-build, moment-timezone with the latest tzdata from IANA's websitePatches
Problem has been patched in version 0.5.35, patch should be applicable with minor modifications to all affected versions. The patch includes changing the FTP endpoint with an HTTPS endpoint.
Workarounds
Specify the exact version of tzdata (like
2014d
, full command beinggrunt data:2014d
, then run the rest of the release tasks by hand), or just apply the patch before issuing the grunt command.GHSA-56x4-j7p9-fcf9
Impact
All versions of moment-timezone from 0.1.0 contain build tasks vulnerable to command injection.
grunt data:2014d
, where2014d
stands for the version of the tzdata to be used from IANA's website),2014d
in our example), then Mallory can execute arbitrary commands on the machine running the grunt task, with the same privilege as the grunt taskAm I affected?
Do you build custom versions of moment-timezone with grunt?
If no, you're not affected.
Do you allow a third party to specify which particular version you want build?
If yes, you're vulnerable to command injection -- third party may execute arbitrary commands on the system running grunt task with the same privileges as grunt task.
Description
Command Injection via grunt-zdownload.js and MITM on iana's ftp endpoint
The
tasks/data-download.js
script takes in a parameter from grunt and uses it to form a command line which is then executed:Ordinarily, one one run this script using something like
grunt data-download:2014d
, in which case version would have the value2014d
. However, if an attacker were to provide additional content on the command line, they would be able to execute arbitrary codeCommand Injection via data-zdump.js
The
tasks/data-zdump.js
script reads a list of files present in a temporary directory (created by previous tasks), and for each one, assembles and executes a command line without sanitization. As a result, an attacker able to influence the contents of that directory could gain code execution. This attack is exacerbated by timezone data being downloaded via cleartext FTP (described above), but beyond that, an attacker at iana.org able to modify the timezone files could disrupt any systems that build moment-timezone.In this case, an attacker able to add a file to
temp/zic/2014d
(for example) with a filename likeZ; curl www.example.com
would influence the called to exec on line 36 and run arbitrary code. There are a few minor challenges in exploiting this, since the string needs to be a valid filename.Command Injection via data-zic.js
Similar to the vulnerability in /tasks/data-download.js, the /tasks/data-zic.js script takes a version from the command line and uses it as part of a command line, executed without sanitization.
As a result, an attacker able to influence that string can run arbitrary commands. Of course, it requires an attacker able to influence the command passed to grunt, so may be unlikely in practice.
Patches
The supplied patch on top of 0.5.34 is applicable with minor tweaks to all affected versions. It switches
exec
toexecFile
so arbitrary bash fragments won't be executed any more.References
Release Notes
moment/moment-timezone (moment-timezone)
v0.5.35
Compare Source
Thanks to the OpenSSF Alpha-Omega project for reporting these!
v0.5.34
Compare Source
2021e
v0.5.33
Compare Source
2021a
v0.5.32
Compare Source
2020d
v0.5.31
Compare Source
v0.5.30
Compare Source
2020a
NOTE: You might need to un-install @types/moment-timezone. Check
https://github.com/moment/moment-timezone/issues/858 for more info
v0.5.29
Compare Source
v0.5.28
Compare Source
Merged pull request #410 from @adgrace:
moment.tz.zonesForCountry(country_code)
which returns all timezones for the countrymoment.tz(timezone_id).countries()
to get countries for some time zonemoment.tz.countries()
to get all country codesmoment.tz.zones()
already existsv0.5.27
Compare Source
2019c
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.